//Circle.cpp
//Contains the function definitions for the Circle Class

#include <math.h>
#include <iostream>
#include "Circle.h"

using namespace std;

Circle::Circle(const float &p_X, const float &p_Y, float rad)
	:Shape(p_X, p_Y)
{
	setRadius(rad);
	setArea(rad);
	setPerim(rad);
	setDistance();
}

void Circle::setRadius(float rad)
{
	if(rad >= 0.0)
		radius = rad;
	else
		throw invalid_argument("Radius must be greater than zero!");
}

float Circle::getRadius() const
{
	return radius;
}

void Circle::setArea(float rad)
{
	C_area = 3.14159265359 * pow(rad, 2);
}

float Circle::getArea() const
{
	return C_area;
}

void Circle::setPerim(float rad)
{
	C_perimeter = 2*3.14159265359 * rad;
}

float Circle::getPerim() const
{
	return C_perimeter;
}

float Circle::area() const
{
	return getArea();
}

float Circle::perimeter() const
{
	return getPerim();
}

float Circle::volume() const
{
	return 0.0;
}

